﻿using System;


namespace TopBuilds.Restaurant.Data
{
    public enum TableState
    {
        /// <summary>
        /// 正常空台
        /// </summary>
        Normal = 0,

        /// <summary>
        /// 已经预订
        /// </summary>
        Reserved = 1,

        /// <summary>
        /// 开台，未落单
        /// </summary>
        Opened = 2,

        /// <summary>
        /// 已经落单或正在用餐
        /// </summary>
        Ordered = 3,

        /// <summary>
        /// 已经埋单
        /// </summary>
        Checked = 4,
    }

    public class Table
    {
        #region 属性
        private int         _id;
        private int         _tableCategoryId;
        private int         _tablePropertyId;
        private int         _roomId;
        private string      _name;
        private int         _seatCount;
        private TableState  _businessState;
        private string      _remark;
        #endregion 

        #region 构造
        public Table()
        {
            _tableCategoryId            = 0;
            _tablePropertyId            = 0;
            _roomId                     = 0;
            _name                       = null;
            _seatCount                  = 0;
            _businessState              = 0;
            _remark                     = null;
        }

        public Table(int tableCategoryId)
        {
            _tableCategoryId            = tableCategoryId;
            _tablePropertyId            = 0;
            _name                       = null;
            _seatCount                  = 0;
            _businessState              = 0;
            _remark                     = null;
        }

        public Table(int tableCategoryId, int tablePropertyId)
        {
            _tableCategoryId            = tableCategoryId;
            _tablePropertyId            = tablePropertyId;
            _name                       = null;
            _seatCount                  = 0;
            _businessState              = 0;
            _remark                     = null;
        }

        public Table(int tableCategoryId, int tablePropertyId,int roomId)
        {
            _tableCategoryId           = tableCategoryId;
            _tablePropertyId           = tablePropertyId;
            _roomId                    = roomId;
            _name                      = null;
            _seatCount                 = 0;
            _businessState             = 0;
            _remark                    = null;
        }

        public Table(int tableCategoryId, int tablePropertyId,int roomId,string name)
        {
            _tableCategoryId           = tableCategoryId;
            _tablePropertyId           = tablePropertyId;
            _roomId                    = roomId;
            _name                      = name;
            _seatCount                 = 0;
            _businessState             = 0;
            _remark                    = null;
        }

        public Table(int tableCategoryId, int tablePropertyId, int roomId, string name, int seatCount)
        {
            _tableCategoryId           = tableCategoryId;
            _tablePropertyId           = tablePropertyId;
            _roomId                    = roomId;
            _name                      = name;
            _seatCount                 = seatCount;
            _businessState             = 0;
            _remark                    = null;
        }

        public Table(int tableCategoryId, int tablePropertyId, int roomId, string name, int seatCount, TableState businessState)
        {
            _tableCategoryId           = tableCategoryId;
            _tablePropertyId           = tablePropertyId;
            _roomId                    = roomId;
            _name                      = name;
            _seatCount                 = seatCount;
            _businessState             = businessState;
            _remark                    = null;
        }

        public Table(int tableCategoryId, int tablePropertyId, int roomId, string name, int seatCount, TableState businessState, string remark)
        {
            _tableCategoryId           = tableCategoryId;
            _tablePropertyId           = tablePropertyId;
            _roomId                    = roomId;
            _name                      = name;
            _seatCount                 = seatCount;
            _businessState             = businessState;
            _remark                    = remark;
        }
        #endregion

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        public int TableCategoryId
        {
            get { return _tableCategoryId; }
            set { _tableCategoryId = value; }
        }

        public int TablePropertyId
        {
            get { return _tablePropertyId; }
            set { _tablePropertyId = value; }
        }

        public int RoomId
        {
            get { return _roomId; }
            set { _roomId = value; }
        }

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public int SeatCount
        {
            get { return _seatCount; }
            set { _seatCount = value; }
        }

        public TableState BusinessState
        {
            get { return _businessState; }
            set { _businessState = value; }
        }

        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }
        public override string ToString()
        {
            return Name;
        }
    }
}
